package com.haiqiu.system.config;

import org.springframework.context.annotation.Bean;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.Tag;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;

/**
 * @author haiqiu
 * TODO 暂时未使用
 */
public class AppConfig {

    private static final String TAG_DEPT = "部门管理";

    private static final String TAG_ROLE = "角色管理";

    private static final String TAG_USER = "用户管理";

    private static final String TAG_AUTH = "权限管理";


    public Docket createDocket(String basePackage) {
        return new Docket(DocumentationType.SWAGGER_2).select()
                .apis(RequestHandlerSelectors.basePackage(basePackage)).build();
    }


    @Bean
    public Docket createDocket() {
        return createDocket("love.zenka.system.controller")
                .tags(new Tag(TAG_DEPT, "部门管理相关接口"))
                .tags(new Tag(TAG_ROLE, "角色管理相关接口"))
                .tags(new Tag(TAG_USER, "用户管理相关接口"))
                .tags(new Tag(TAG_AUTH, "权限管理相关接口"));
    }
}
